package com.guoxin.part1.chapter3;

/**
 * 获取线程ID
 *
 * @author guoxin
 * @date 2019/8/27
 */
public class ThreadId {
    public static void main(String[] args) {
        long mainId = Thread.currentThread().getId();
        System.out.println("Main id: " + mainId);

        Thread t = new Thread();
        t.start();
        long tId = t.getId();
        System.out.println("thread t id:" + tId);
    }
}
